<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page language="java" import="java.util.*" %>
<%@ page language="java" import="com.tangdi.production.mpapp.utils.WebPayServletUtil"
	%>
<%@ page language="java" import="com.tangdi.production.mpapp.constants.Key"
	%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";

	WebPayServletUtil payUtil = new WebPayServletUtil();

	//out.write(basePath);

	//如果已登录,跳转到首页
	boolean ok = payUtil.validation(request, response);
	if (ok) {
		payUtil.toIndexPage(request, response);
	}
	request.setAttribute("title", "登录");
%>
<!DOCTYPE html>
<html lang="zh">
<head>
<base href="<%=basePath%>">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>商户登录</title>

<meta name="description" content="Common form elements and layouts" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<script type="text/javascript" src="js/jquery-1.7.1.min.js"
	charset="UTF-8"></script>

<script type="text/javascript" src="js/core-1.0.js" charset="UTF-8"></script>
<script type="text/javascript" src="js/webpay/base.js" charset="UTF-8"></script>

<script type="text/javascript">
	
</script>

<!-- bootstrap & fontawesome -->
<link rel="stylesheet" href="ace_v1.3/assets/css/bootstrap.css" />

<link rel="stylesheet" href="ace_v1.3/assets/css/chosen.css" />

<!-- text fonts -->
<link rel="stylesheet" href="ace_v1.3/assets/css/ace-fonts.css" />

<link rel="stylesheet" href="ace_v1.3/assets/css/font-awesome.css" />
<link rel="stylesheet" href="css/webpay/core.1.0.css" />
<link rel="stylesheet" href="css/dialog.css" />
<!-- ace styles -->
<link rel="stylesheet" href="ace_v1.3/assets/css/ace.css"
	class="ace-main-stylesheet" id="main-ace-style" />

<link res="stylesheet" href="css/webpay/index.css"/>

<!--[if lte IE 9]>
			<link rel="stylesheet" href="ace_v1.3/assets/css/ace-part2.css" class="ace-main-stylesheet" />
		<![endif]-->

<!--[if lte IE 9]>
		  <link rel="stylesheet" href="ace_v1.3/assets/css/ace-ie.css" />
		<![endif]-->



<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

<!--[if lte IE 8]>
		<script src="ace_v1.3/assets/js/html5shiv.js"></script>
		<script src="ace_v1.3/assets/js/respond.js"></script>
		<![endif]-->

<jsp:include page="plug/head-include.jsp" />
<style type="text/css">
.logo-text{
	text-align:center;
	font-size: 25px;
	font-weight: 700;
	width: 100%;
	background:-webkit-linear-gradient(left,#f00,#366 25%,#66f 40%,#c09 50%,#906 40%,#009);
   -webkit-background-clip:text;
   color:transparent;
}
.logo-title-img{
	width: 120px;
	border-radius: 10px;
}
</style>
</head>

<body class="no-skin">
	<!-- #section:basics/navbar.layout -->
	<jsp:include page="plug/title.jsp" />

	<!-- /section:basics/navbar.layout -->
	<div class="main-container" id="main-container">

		<!-- #section:basics/sidebar -->
		<div class="main-content">
			<div class="main-content-inner">
				<!-- #section:basics/content.breadcrumbs -->
				<!-- /section:basics/content.breadcrumbs -->
				<div class="page-content">
					<!-- #section:settings.box -->
					<!-- <div class="page-header">
						<h1>
							Form Elements <small> <i
								class="ace-icon fa fa-angle-double-right"></i> Common form
								elements and layouts
							</small>
						</h1>
					</div>
					 -->
					<!-- /.page-header -->
					
					<div class="col-sm-8 col-xs-12 col-sm-offset-2 space-1"></div>
					
					<div class="row"
						style="padding: 0;text-align: center;">
						<div class="col-sm-8 col-xs-12 col-sm-offset-2 logo-title">
							<!-- <img src="images/logo-title.png" width="120" class="logo-title-img"> -->
						</div>
					</div>
					
					<div class="row">
						<div style="text-align: center;margin-top: 10px;">
							<span class="logo-text">
								
							</span>
						</div>
					</div>
					
					<div class="col-sm-8 col-xs-12 col-sm-offset-2 space-1"></div>
					
					<div class="row">
						<div class="col-xs-12">
							<!-- PAGE CONTENT BEGINS -->
							<form class="form-horizontal" method="post" action="SY0003.web"
								id="orderPayForm" role="form"
								onsubmit="return validateCallback(this,loginSuccess)">

								<div class="form-group">
									<div class="col-sm-8 col-xs-12 col-sm-offset-2">
												<input type="text" name="custMobile" validate="true"
											placeholder="请输入登录手机号" class="form-control" />
									</div>
								</div>

								<div class="form-group">
									<div class="col-sm-8 col-xs-12 col-sm-offset-2">
										<!-- <span class="input-group-addon">
											<i class="ace-icon fa fa-phone"></i>
										</span> -->
										<input type="password" name="custPwd" validate="true"
											placeholder="请输入登录密码" class="form-control" />
									</div>
								</div>

								<div class="form-group">
									<div class="col-sm-8 col-xs-12 col-sm-offset-2">
										<div class="left is-click register">注册</div>
										<div class="right is-click forget">忘记密码？</div>
									</div>
								</div>

								<div
									class="clearfix menu-btn-box col-sm-8 col-xs-12 col-sm-offset-2">
									<button class="btn btn-info btn-lg btn-block" type="submit"
										onclick="">
										<i class="ace-icon fa fa-check "></i> 登 录
									</button>
								</div>
							</form>
							<!-- /.col -->
						</div>
						<!-- /.row -->
					</div>
				</div>
				<!-- /.page-content -->
			</div>
		</div>
		<!-- /.main-content -->


	</div>
	<!-- /.main-container -->

	<!-- basic scripts -->
	<script type="text/javascript">
		/* if(!GetQueryString('_oemId')){
			$.setCookie("_oemId","2015000000");
		} */
		if(!$.getCookie('_oemId')){
			$.setCookie("_oemId","2015000000");
		}
		
		if(isOem()){
			var oem_id = $.getCookie("_oemId");
			formSubmitForAjax({
				url : BASE_PATH + 'AG0001.web',
				data : {agentId:oem_id},
				success : function(json){
					if(codeSuccess(json)){//查询成功
						var agent = json;
						//alert(agent['oemState'] + ' - ' + agent['oemPicId']);
						var imgSrc = "images/logo-title.png";
						var oemName = '浙江树根';
						
						//如果是oem合作商
						if(agent['oemState'] == 1){
							if(agent['oemPicId']){
								imgSrc = BASE_PATH + 'mpbase/pic/view2.json?picid=' + agent['oemPicId'];
							}
							
							if(agent['agentName']){
								oemName = agent['agentName'];
								$.setCookie('_oemName',encodeURI(oemName));
							}
						}
						//alert($.getCookie('_oemName'));
						$('.logo-title').append('<img src="' + imgSrc + '" class="logo-title-img"/>');
						$('.logo-text').append(oemName + '收银台');
					}
				}
			});
		}else{
			$('.logo-title').append('<img src="images/logo-title.png" class="logo-title-img"/>');
			$('.logo-text').append('浙江树根收银台');
		}
	</script>
	<script type="text/javascript"
		src="ace_v1.3/assets/js/jquery.maskedinput.js" charset="UTF-8"></script>
	<script type="text/javascript" src="js/jquery.tips.js" charset="UTF-8"></script>
	<script type="text/javascript" src="js/webpay/login.js" charset="UTF-8"></script>
</body>
</html>
